Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions That Modify Movie Properties / Working With Media Samples


SampleNumToMediaTime

The SampleNumToMediaTime function allows you to find the time at which a specified sample plays. This time is expressed in the media's time scale.

pascal void SampleNumToMediaTime (Media theMedia, 
                                    long logicalSampleNum, 
                                    TimeValue *sampleTime,
                                    TimeValue *sampleDuration);
theMedia
Specifies the media for this operation. You obtain this media identifier from such Movie Toolbox functions as NewTrackMedia and GetTrackMedia (described on page 2-138 and page 2-190, respectively).
logicalSampleNum

Specifies the sample number.
sampleTime
Contains a pointer to a time value. The MediaTimeToSampleNum function updates this time value to indicate the starting time of the sample specified by the logicalSampleNum parameter. This time value is expressed in the media's time scale. Set this parameter to nil if you do not want this information.
sampleDuration
Contains a pointer to a time value. The Movie Toolbox returns the duration of the sample specified by the logicalSampleNum parameter. This time value is expressed in the media's time scale. Set this parameter to nil if you do not want this information.
ERROR CODES
invalidMedia-2008This media is corrupted or invalid
SEE ALSO
You can find the sample for a specified time by calling the MediaTimeToSampleNum function, which is described in the previous section.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996